<template>
  <div>
    <div class='menu_content'>
        <!-- 头像 -->
        <div class='head_image'>
          <img :src="uesr.head_img" alt="">
        </div>
        <!-- 昵称 -->
        <h3>{{uesr.name}}</h3>
        <!-- 个性签名 -->
        <p>--{{uesr.signature}}--</p>
        <!-- 栏目菜单 -->
        <columnList-temp/>
        <!-- 社交链接 -->
        <div class='links'>
          <ul>
            <li><a href='https://github.com/' class='iconfont icon-github1'/></li>
            <li><a href='https://www.zhihu.com' class='iconfont icon-zhihu'/></li>
            <li @mouseover='showQRCode(0)' @mouseout="hiddenQRCode(0)"><a href='#' class='iconfont icon-weibo'/></li>
            <li @mouseover='showQRCode(1)' @mouseout="hiddenQRCode(1)"><a href='#' class='iconfont icon-weixin'/></li>
          </ul>
        </div>
        <!-- 二维码 -->
        <span class='wei_bo' v-if='show_wei_bo'><img src="../../assets/images/wei_bo.jpg" alt="微博二维码"></span>
        <span class='wei_xin' v-if='show_wei_xin'><img src="../../assets/images/wei_xin.jpg" alt="微信二维码"></span>
      </div>
  </div>
</template>

<script>

  import columnListTemp from './columnlist'
  import {mapState} from 'vuex'

  export default {
    data() {
      return {
        uesr:{
            head_img:"https://showcc.github.io/img/head.jpg",
            name:"Hfg",
            signature:"123123123"
        },
        show_wei_bo: false,
        show_wei_xin: false
      }
    },
    components: {
      columnListTemp
    },
    computed: {
      ...mapState(['useInfo'])
    },
    methods:{
      showAndHidden(index,boolean) {
        if(index == 0) {
          this.show_wei_bo = boolean;
        }else if (index == 1) {
          this.show_wei_xin = boolean
        }
      },
      showQRCode(index) {
        this.showAndHidden(index,true)
      },
      hiddenQRCode(index) {
        this.showAndHidden(index,false)
      }
    }
  }
</script>

<style scoped>
.menu_content {
  width: 250px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
}
.head_image {
  width: 130px;
  height: 130px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 15px;
}
.head_image>img {
  width: 100%;
}
.menu_content>p {
  margin: 15px 0;
  font-size: 12px;
}
.links>ul {
  width: 150px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
.links>ul>li {
  width: 25px;
  height: 25px;
  border-radius: 50%; 
  text-align: center;
  line-height: 25px;
  overflow: hidden;
}
.links>ul>li:nth-child(1) {
  background: #000;
}
.links>ul>li:nth-child(2) {
  background: #0663C1;
}
.links>ul>li:nth-child(3) {
  background: #FF0000;
}
.links>ul>li:nth-child(4) {
  background: #86DB49;
}
.links>ul>li>a {
  color: #fff;
  text-decoration: none;
}
.menu_content>span {
  position:absolute;
  bottom: -90px;
  width: 80px;
  height: 80px;
  overflow: hidden;
  border: 2px solid #2f2f2f;
  border-radius: 5px;
}
.menu_content>span>img {
  width: 100%;
}
.menu_content .wei_xin {
  right: 20px;
}
.menu_content .wei_bo {
  right: 60px;
}
</style>